{extend name="layout/iframe" /}
{block name="pagecss"}
<style>
    .layui-form-select .layui-input{
        padding-right: 0;
        cursor: pointer;
    }
    input::-webkit-input-placeholder {
        text-align:right;
    }
</style>
{/block}
{block name="content"}
<div class="layui-card-body layui-layout-admin" style="padding: 15px;">
    <form class="layui-form" action="" lay-filter="component-form-group">

        <label class="layui-form-label"><span class="required">*</span>广告图片</label>
        <div class="layui-col-md3 layui-col-xs5 layui-form-item" style="margin-left: 110px;margin-top: -30px;">
            <div id="upload-image">
                <div class="layui-upload-list thumbBox mag0 magt3" id="upload-btn" data-multi="false">
                    <input type="hidden" class="layui-input" name="title_url" value="">
                    <img class="layui-upload-img thumbImg" src="">
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span class="required">*</span>广告名称</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input"  name="name" lay-verify="required" placeholder="请输入" autocomplete="off">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label"><span class="required">*</span>广告形式</label>
            <div class="layui-input-block">
                <select  name="type" lay-verify="required">
                    {foreach $adbanner as $k => $v}
                    <option value="{$k}">{$v}</option>
                    {/foreach}
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否启用链接位置</label>
            <input type="checkbox" name="status_link_type" id="status_link_type" lay-filter="status_link_type" lay-skin="switch" lay-text="启用|不启用"><div class="layui-unselect layui-form-switch status_detail_product" lay-skin="_switch"><em>启用</em><i></i></div>
        </div>

        <div class="layui-form-item status_link_text layui-hide">
            <label class="layui-form-label">链接位置</label>
            <div class="layui-input-block">
                <select  name="link_type" lay-verify="required">
                    <option value="0">请选择</option>
                    {foreach $linktype as $k => $v}
                    <option value="{$k}">{$v}</option>
                    {/foreach}
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span class="required">*</span>开始日期</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="start_time" name="start_time" lay-verify="required" placeholder="yyyy-MM-dd">
            </div>　　
            <label class="layui-form-label" style="width: 20%"><span class="required">*</span>结束日期</label>
            <div class="layui-input-inline" >
                <input type="text" class="layui-input" id="end_time" name="end_time" lay-verify="required" placeholder="yyyy-MM-dd">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否启用专题商品</label>
            <input type="checkbox" name="status_detail_product" id="status_detail_product"  lay-filter="status_detail_product" lay-skin="switch" lay-text="启用|不启用"><div class="layui-unselect layui-form-switch status_detail_product" lay-skin="_switch"><em>启用</em><i></i></div>
        </div>

        <div class="status_detail_text layui-hide">
        <div class="layui-col-md3 layui-col-xs5 layui-form-item" style="margin-left: 110px;">
            <div id="upload-image2">
                <div class="layui-upload-list thumbBox mag0 magt3" id="upload-btn2" data-multi="false">
                    <input type="hidden" class="layui-input" name="detail_url" value="">
                    <img class="layui-upload-img thumbImg" src="">
                </div>
            </div>
        </div>

        <div class="payment-rule">
            <div class="payment-rule-group">
                <div class="layui-form-item layui-form-text rule-group">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <div class="layui-inline">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-inline">
                        <button type="button" class="layui-btn layui-btn-normal addPro-btn"><i class="layui-icon"></i>新增专题商品</button>
                    </div>
                </div>
            </div>
        </div>
        </div>

        <div class="layui-form-item">
        <label class="layui-form-label">是否启用单个商品</label>
        <input type="checkbox" class="status_one_product" id="status_one_product" name="status_one_product" lay-filter="status_one_product" lay-skin="switch" lay-text="启用|不启用"><div class="layui-unselect layui-form-switch " lay-skin="_switch"><em>启用</em><i></i></div>
        </div>

        <div class="payment-rule status_one_text layui-hide">
            <div class="layui-form-item layui-form-text rule-group">
                <div class="layui-form-item addPro2-btn">
                    <label class="layui-form-label">选择优惠商品</label>
                    <div class="layui-input-block">
                        <button class="layui-input" lay-event="purchase-o" id="product_name" type="button"  data-title="选择">请选择</button>
                        <input type="hidden" name="link_product" lay-verify="link_product" id="link_product" value="">
                    </div>
                </div>
            </div>
        </div>


        <div class="layui-form-item layui-row layui-col-xs12">
            <div class="layui-input-block">
                <div class="layui-footer">
                    <button type="button" class="layui-btn layui-btn-primary close-btn">取消</button>
                    <button class="layui-btn" type="button" lay-submit="" lay-filter="laySave">保存 <i class="layui-icon">&#xe609;</i></button>
                </div>
            </div>
        </div>
    </form>
</div>


<input type="hidden" class="token_url" value="{:url('admin/Image/token')}">
<input type="hidden" class="record_url" value="{:url('admin/Image/record')}">
<input type="hidden" class="delimage_url" value="{:url('admin/Image/delete')}">
<input type="hidden" class="save_url" value="{:url('admin/'.strtolower($model).'/savePost')}">
<input type="hidden" class="get_product_url" value="{:url('admin/'.strtolower($model).'/get_product_all')}">
<input type="hidden" class="get_product_url2" value="{:url('admin/'.strtolower($model).'/get_product_one')}">
<input type="hidden" class="handle_url" value="{:url('admin/'.strtolower($model).'/handle')}">

{/block}

{block name="pagescript"}
<script src="__STATIC__/admin/js/qiniu/plupload.full.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniu.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniuConfig.js" type="text/javascript"></script>

<script src="__STATIC__/admin/pages/js/uploadfile02.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/adbanner.js" type="text/javascript"></script>
{/block}